home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 050a / tse_mac1.zip / TIMEDATE.ZIP / TIMEDATE.S < prev   
Text File  |  1993-04-16  |  3KB  |  109 lines

  1. //  TSE macros:  time(), date(), timedate(), fulldate(), timezone()
  2. //  Friday - April 16, 1993  @18:17
  3. //  File:  timedate.s, timedate.zip
  4. //  Editor:  Tom Klein, TAKnet Information Service; Fort Wayne, IN
  5. //  With the initial ideas generated by:
  6. //  02-14-93: Submitted by Mel Hulse
  7. //  03-09-93: KAC - Rewritten, commented, and tested.
  8. //  04-15-93: TAK - expanded from fulldate only to 5 functions of time/date
  9.  
  10. //  Macros(5) that inserts the current date with the full name of the month.
  11. //  time() = 18:22, date() = 04/16/93, timedate() = 04/16/93  18:22
  12. //  fulldate() = Friday - April 16, 1993, timezone()=18:23 EST/CDT
  13. //
  14. // ASSUMPTIONS: The cursor should be in the file where you wish the function
  15. //              to begin.  The current insert mode will be used.  i.e. if
  16. //              currently in overwrite mode, the date will overwrite,
  17. //              otherwise the date will be inserted.
  18. //
  19. // PARAMETERS:  none
  20. //
  21. // RETURNS:     none
  22. //
  23. // GLOBAL VARS: none
  24. //
  25. // LOCAL VARS:  mon, day, year, dow - month, day, year, and day of week
  26. //              month_name          - local string to hold full month name
  27. //
  28.  
  29. //
  30.  
  31. PUBLIC proc  fulldate()
  32.  
  33.     integer mon, day, year, dow
  34.     string  month_name[9] = ''
  35.     string  day_of_week[9]= ''
  36.  
  37.     GetDate(mon, day, year, dow)    // get current date
  38.  
  39.     case mon
  40.         when  1 month_name = 'January'
  41.         when  2 month_name = 'February'
  42.         when  3 month_name = 'March'
  43.         when  4 month_name = 'April'
  44.         when  5 month_name = 'May'
  45.         when  6 month_name = 'June'
  46.         when  7 month_name = 'July'
  47.         when  8 month_name = 'August'
  48.         when  9 month_name = 'September'
  49.         when 10 month_name = 'October'
  50.         when 11 month_name = 'November'
  51.         when 12 month_name = 'December'
  52.     endcase
  53.  
  54.     case dow
  55.         when  1 day_of_week = 'Sunday'
  56.         when  2 day_of_week = 'Monday'
  57.         when  3 day_of_week = 'Tuesday'
  58.         when  4 day_of_week = 'Wednesday'
  59.         when  5 day_of_week = 'Thursday'
  60.         when  6 day_of_week = 'Friday'
  61.         when  7 day_of_week = 'Saturday'
  62.     endcase
  63.  
  64.  
  65.     InsertText(Format(Day_of_Week,' - ',Month_name,' ',day,', ',year))
  66.  
  67.  
  68. end  // End of FullDate()
  69.  
  70.  
  71. PUBLIC proc  time()
  72.  
  73.     string  time [5]
  74.  
  75.     time=GetTimeStr()
  76.     time=substr(time,1,5)
  77.     InsertText(time)
  78.  
  79. end  // time()
  80.  
  81.  
  82. PUBLIC proc  timezone()
  83.  
  84.     string  timezone[20]
  85.  
  86.     timezone=GetTimeStr()
  87.     timezone=(Format (substr(timezone,1,5),' EST/CDT'))
  88.     InsertText(timezone)
  89.  
  90. end  // timezone()
  91.  
  92. PUBLIC proc  date()
  93.  
  94.     string  date[10]
  95.     date=GetDateStr()
  96.     InsertText(date)
  97.  
  98. end  // date()
  99.  
  100. PUBLIC proc  timedate()
  101.  
  102.       date()
  103.       InsertText('  ')
  104.       time()
  105.  
  106. end  // timedate()
  107.  
  108. //  File:  timedate.s, timedate.zip  Friday - April 16, 1993
  109.